package icu.shaoyayu.admin.api.interfaces.facade;


import icu.shaoyayu.common.log.aop.WebLogger;
import icu.shaoyayu.common.utll.R;
import icu.shaoyayu.common.utll.ReturnUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author shaoyayu
 * @date 2022/2/16
 * @apiNote
 */
@Api(tags = "管理员")
@RestController
@RequestMapping("/admin")
public class AdministratorsController {

    @WebLogger("获取所有管理员")
    @ApiOperation("获取所有管理员")
    @GetMapping("/allUser")
    public R<Object> getAllAdminUser(){
        List<Map<String, String>> mapList = new ArrayList<>();
        for (int i = 0; i <10; i++) {
            Map<String, String> map = new HashMap<>();
            map.put("user","user"+1);
            map.put("age",""+(i*2)+"岁");
            mapList.add(map);
        }
        return ReturnUtil.success("请求成功",mapList,mapList.size());
    }

}
